package com.runner.tutorial;

import java.util.ArrayList;

import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.NinePatch;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.runner.observer.Subject;
import com.runner.utility.Constants;
import com.runner.utility.Locator;

public abstract class Tutorial implements Constants {

	protected boolean completed;
	protected Subject subject;
	protected NinePatch background;
	protected SpriteBatch sb;
	protected BitmapFont font;
	protected String display;
	protected ArrayList<String> tips;
	protected int count;
	protected Stage stage;

	public Tutorial(Subject subject, BitmapFont font) {
		completed = false;
		this.subject=subject;
		background=new NinePatch(Locator.getAssets().get(PANEL_PATH, Texture.class));
		sb=new SpriteBatch();
		this.font=font;
		count=0;
		tips=new ArrayList<String>();
		//this.font.setColor(Color.DARK_GRAY);
		stage=new Stage(Locator.getViewport());
		sb.setTransformMatrix(stage.getCamera().view);
		sb.setProjectionMatrix(stage.getCamera().projection);
		
	}

	public abstract void render();

	public abstract void update(float delta);
	
	public void tap(){
		next();
	}
	
	public void next(){
		display=tips.get(count);
		count++;
	}

}
